package com.wgl.demo;

import android.os.Bundle;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;

import com.wgl.support.view.CustomProgressBar;

public class MainActivity extends AppCompatActivity {
    private CustomProgressBar mProgressBar;
    private int i = 0;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mProgressBar = (CustomProgressBar) findViewById(R.id.progress);
        mHandler.postDelayed(mAction, 300);
    }

    private Handler mHandler = new Handler();

    private Runnable mAction = new Runnable() {
        @Override
        public void run() {
            if (i <= 100) {
                mProgressBar.setProgress(i);
                i++;
                mHandler.postDelayed(mAction, 300);
            }
        }
    };
}
